package com.china.produce.service.link.factory;

import com.china.produce.service.link.LinkArmory;
import com.china.produce.service.link.chain.BusinessLinkedList;
import com.china.produce.service.link.logic.RuleLogic201;
import com.china.produce.service.link.logic.RuleLogic202;
import com.china.produce.service.link.logic.RuleResponse;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service;

/**
 * @ClassName
 * @Author niujie
 * @Version
 * @Description
 * @CreateTime 2025/3/19
 */
@Service
public class Rule02TradeRuleFactory {

    @Bean("demo1")
    public BusinessLinkedList<String, DynamicContext, RuleResponse> demo1(RuleLogic201 ruleLogic201, RuleLogic202 ruleLogic202) {

        LinkArmory<String, DynamicContext, RuleResponse> link1 = new LinkArmory<>("link1", ruleLogic201, ruleLogic202);

        return link1.getLogicLink();
    }


    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    public static class DynamicContext {
        private String age;
    }
}
